<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>基础例子</title>
    <script src="../js/vue-dev.js"></script>
</head>
<body>

    <div id="app_computed">
        文本输入：<input v-model="msg">
        <p>Original Message: {{msg}}</p>
        <p>Computed reversed Message: {{reversedMessage}}</p>
    </div>

    <script>
        var app_computed = new Vue({
            el:'#app_computed',
            data:{
                msg:'Hello',
            },
            computed:{
                reversedMessage:function () {
                    //'this' point to the app_computed instance
                    return this.msg.split('').reverse().join('');
                }
            }
        })
    </script>
</body>
</html>